<?php
/**
 * Created by PhpStorm.
 * User: River
 * Email: river0428@gmail.com
 * Date: 2018/9/28
 * Time: 下午6:09
 */
//微信消息回调
Route::any('/wx_message', 'WXMessage@index');
//用户注册
Route::post('/api/user/register', 'UserController@register');
//用户登录
Route::post('/api/user/login', 'UserController@login');

Route::get('/api/user/update', 'UserController@update');

Route::post('/api/user/linkcode', 'UserController@linkcode');

Route::post('/api/send_sms', 'UserController@sendSms');

Route::get('/api/notice/recharge', 'NoticeController@index');

Route::get('/api/payment_methods', 'RechargeController@paymentMethods');

//Route::get('/api/test_pay/{id}', 'RechargeController@testPay');

Route::get('/api/qa', 'ArticleController@category');
Route::get('/api/qa/{id}', 'ArticleController@article');

Route::any('/api/payment/notify/alipay', 'PaymentNotifyController@alipay');
Route::any('/api/payment/notify/weixin_app', 'PaymentNotifyController@weixinApp');
Route::any('/api/payment/notify/weixin', 'PaymentNotifyController@weixin');

// home
Route::get('/api/home', 'HomeController@index');

Route::get('/api/faxian', 'HomeController@faxian');

Route::get('/api/is_verified', 'UserController@isVerified');

Route::get('/api/share_info', 'HomeController@share');
Route::get('/api/jssdk', 'HomeController@jssdk');

Route::any('/api/demo','MobileRechargeController@demo');

Route::any('/api/app/control','AppController@control');

Route::middleware('api.sign')->group(function() {
    Route::post('/api/user/oil_card', 'OilCardController@store');
    Route::get('/api/user/detail', 'UserController@detail');
    Route::get('/api/user/coupon', 'UserController@coupons');

    Route::get('/api/user/can_use_coupon', 'UserController@canUseCoupons');

    Route::get('/api/recharge', 'RechargeController@index');
    Route::post('/api/recharge', 'RechargeController@store');
    Route::post('/api/recharge_order/{id}/pay', 'RechargeController@pay');
    Route::post('/api/mobile_recharge_order/{id}/pay', 'MobileRechargeController@pay');
    Route::delete('/api/user/oil_card/{id}', 'OilCardController@destroy');
    Route::post('/api/user/oil_card/{id}/set_default', 'OilCardController@setDefault');

    Route::get('/api/mobile_recharge','MobileRechargeController@index');
    Route::post('/api/mobile_recharge', 'MobileRechargeController@store');
    Route::post('/api/mobile_recharge_order/{id}/pay', 'MobileRechargeController@pay');

    Route::post('/api/user/change_mobile', 'UserController@changeMobile');
    Route::post('/api/user/change_password', 'UserController@changePassword');

    Route::post('/api/feedback', 'FeedbackController@store');

    //油卡订单
    Route::get('/api/order', 'RechargeController@order');
    Route::get('/api/order_detail', 'RechargeController@order_detail');
    //话费订单
    Route::get('/api/mobile_order', 'MobileRechargeController@order');
    Route::get('/api/mobile_order_detail', 'MobileRechargeController@order_detail');

});
